const fs = require("fs");
const path = require("path");
fs.stat(path.resolve(__dirname, "./test.txt"), function (err, stat) {
  if (err) {
    console.log(err);
  } else {
    console.log("isFile:" + stat.isFile());
    console.log("isDir:" + stat.isDirectory());
    if (stat.isFile()) {
      console.log("file size:" + stat.size);
      console.log("create time: " + stat.birthtime);
      console.log("modified time: " + stat.mtime);
    }
  }
});
